<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="java.sql.*" %>
<%@ page import="Loglj.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
   
  </head>
  
  <body>
<% 
String user = request.getParameter("user");
String pass1 = request.getParameter("pass1");
String pass2 = request.getParameter("pass2");

if(!pass1.equals(pass2)){
out.print("<script>");
out.print("注册失败，两次密码不一样!!!");
out.print("window.localhost='/Mysql/index.jsp'");
out.print("</script>");
}else if(pass1.equals(pass2)){
Connection con=Ljmysql.getConnection();
Statement stat=con.createStatement();
stat.executeUpdate(String.format("insert into df(user,pass1) values('%s','%s')" ,user,pass1));
out.print("<script>");
out.print("注册失成功");
out.print("window.localhost='/Mysql/Dlcg.jsp'");
out.print("</script>");
}

%>
  </body>
</html>